#define _CRT_SECURE_NO_WARNINGS 1
#include "List.h"

void ListTest1()
{
	ListNode* plist = LTInit();
	LTPushBack(plist, 1);
	LTPushBack(plist, 2);
	LTPushBack(plist, 3);
	LTPushBack(plist, 4);
	LTPrint(plist);

	LTPopBack(plist);
	LTPopBack(plist);

	LTPrint(plist);
}

void ListTest2()
{
	ListNode* plist = LTInit();
	LTPushFront(plist, 1);
	LTPushFront(plist, 2);
	LTPushFront(plist, 3);
	LTPushFront(plist, 4);
	LTPrint(plist);

	LTPopFront(plist);
	LTPopFront(plist);
	LTPrint(plist);
}

void ListTest3()
{
	ListNode* plist = LTInit();
	LTPushBack(plist, 1);
	LTPushBack(plist, 2);
	LTPushBack(plist, 3);
	LTPushBack(plist, 4);
	LTPrint(plist);

	ListNode* pos = LTFindNode(plist, 3);
	LTInsertBefore(pos, 10);
	LTPrint(plist);
	LTErase(pos);
	LTPrint(plist);

	LTDestroy(&plist);

}

int main()
{
	ListTest3();

	return 0;
}